<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8" />
    <title>确认框</title>
    <script>
        var flag = confirm("您确认登录么?");
        if (flag) {
            console.log("确认登录");
        } else {
            console.log("不确认登录");
        }
    </script>

<body>
</body>